<?php

defined('IN_IA') or exit('Access Denied');
global $_GPC, $_W;
 
$uniacid = $_W['uniacid'];
$uid = $_W['member']['uid'];
$openid = $_W['openid'];
load()->func('tpl');
load()->func('logging');  

 /**
  * http://api.siyueweb.cn/app/index.php?i=19&c=entry&op=show&id=19&do=vrview&m=kbwdl_shequzufang#/
  */
 
if( $_GPC['gtpc']==1){ 
  $id = intval($_GPC['id']); 
  $ret  = pdo_fetch("select * from ".tablename("kbwdl_house_saleinfo")." where uniacid='$uniacid' and tid='13'  and disabled=0 and id='$id'");
  $piclist = iunserializer($ret['newstext']);
  if(!empty($piclist)){
      function func($v){
           return tomedia($v);
      }
      $piclist = array_map(  "func", $piclist);
  }
  
  $data[0] = [
      'name'=> $ret['fname'],
      'styleObj'=> ['background'=> '#bf0000'],
      'children'=>[
           [ 'name'=> $ret['fname'],
             'styleObj'=> ['background'=> '#bf0000'],
             'jpgNameArr'=> $piclist ,//['http://api.siyueweb.cn/attachment/images/19/2021/09/Y66c6N1m85o8CSX5681x61nrx5oXwn.jpg']
            ]
      ]
  ];
  echo json_encode(['data'=>$data, 'helpinfo'=> $ret['smalltext']]);
}else{ 
 include $this->template("vrview");
};
 

?>
